package bloodfang.gui;

import java.util.Arrays;

public class EquippedItem extends AbstractBindableModel {
	int item_id = 0;
	private int upgradeLevel = 0;
	private int randomSuffix;
	private int enchant = 0;
	int[] gem_ids = new int[3];
	
	public EquippedItem(){
		Arrays.fill(gem_ids, 0);
	}
	
	public int getItemId(){
		return this.item_id;
	}
	
	public void setItemId(int itemId) {
		firePropertyChange("itemId", this.item_id, this.item_id = itemId);
	}
	
	public int getUpgradeLevel(){
		return this.upgradeLevel;
	}
	
	public void setUpgradeLevel(int ulvl){
		firePropertyChange("upgradeLevel", this.upgradeLevel, this.upgradeLevel = ulvl);
	}
	
	public int getEnchant(){
		return this.enchant;
	}
	
	public void setEnchant(int enchant){
		firePropertyChange("enchant", this.enchant, this.enchant = enchant);
	}

	public int getRandomSuffix() {
		return randomSuffix;
	}

	public void setRandomSuffix(int randomSuffix) {
		firePropertyChange("randomSuffix", this.randomSuffix, this.randomSuffix = randomSuffix);
	}
	
	public int getGem(int slot){
		return this.gem_ids[slot];
	}
	
	public void setGem(int socketIndex, int gemid) {
		firePropertyChange("gem"+socketIndex, this.gem_ids[socketIndex], this.gem_ids[socketIndex] = gemid);
	}
}
